package com.mz.demo.controller;

import com.mz.demo.entity.vo.AccountPasswordInfoVo;
import com.mz.demo.entity.vo.LoginResVo;
import com.mz.demo.service.LoginService;
import com.mz.demo.utils.entity.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Resource
    private LoginService loginService;

    @PostMapping("/user/login")
    public R loginByAccountPassword( @RequestBody AccountPasswordInfoVo accountPasswordInfoVo) {

        LoginResVo loginResVo =  loginService.loginByAccountPassword( accountPasswordInfoVo );
        return R.ok(loginResVo);
    }
}
